export const toBase64 = (data) => {
    if (data instanceof Object) {
        return window.btoa(window.encodeURIComponent(JSON.stringify(data)));
    } else {
        return window.btoa(window.encodeURIComponent(data));
    }

}

export const fromBase64 = (data) => {
    return window.decodeURIComponent(window.atob(data));
}
